package edu.sctu.zhuyingzhi.month201506.day20150607;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created by user13 on 2015/6/7.
 */
public class DayClient {
    public int iterator(List list){
        int i = 0;

        Iterator iterator = list.iterator();
        while(iterator.hasNext()){
            i++;
            iterator.next();

        }return i;
    }
    public static void main(String[] args) {
        List list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        System.out.println(new DayClient().iterator(list));
    }
}
